package top.xia17.plugins.fast.auth.security;

import top.xia17.plugins.fast.common.database.redis.RedisUtils;
import top.xia17.plugins.fast.common.autoconfiguration.TokenProperties;
import top.xia17.plugins.fast.common.security.token.provider.SimpleRedisTokenProvider;
import top.xia17.plugins.fast.common.security.token.provider.TokenProvider;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * token提供配置
 *
 * @author xia17
 * @since 2021/12/8 16:32
 */
@Configuration
@RequiredArgsConstructor
public class TokenProviderConfig {


    private final RedisUtils redisUtils;
    private final TokenProperties tokenProperties;

    /**
     * 简单的redisToken提供
     *
     * @return TokenProvider
     */
    @Bean
    public TokenProvider simpleRedisTokenProvider() {
        return new SimpleRedisTokenProvider(redisUtils, tokenProperties);
    }


}
